package cn.cityhouse.avm.stat;

import static org.junit.Assert.*;

import org.apache.commons.math3.linear.RealVector;
import org.junit.Assert;
import org.junit.Test;

public class Confint {
	private static final double normTolerance = 10e-6;

	@Test
	public void Confinttest() {
		//		fail("Not yet implemented");
		RealVector rlv_confint=SummaryStats.getConfint(-98310.88757, 316, 3, 12248.98365,  0.95);
		//test for t value
		Assert.assertEquals(rlv_confint.getEntry(0),-8.02604, normTolerance);
		//test for  Pr(>|t|)
		Assert.assertEquals(rlv_confint.getEntry(1),2.04281e-14, normTolerance);
		//test for lower confidence 
		Assert.assertEquals(rlv_confint.getEntry(2), -122411.347145, normTolerance);
		//test for upper confidence 
		Assert.assertEquals(rlv_confint.getEntry(3), -74210.427993, normTolerance);
	}

}
